# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>

pkgname=python-pypandoc
pkgver=1.11
pkgrel=2
pkgdesc="Thin wrapper for pandoc"
arch=('any')
license=('MIT')
url="https://github.com/bebraw/pypandoc"
depends=('pandoc')
makedepends=('python-build' 'python-installer' 'python-poetry-core' 'python-wheel')
checkdepends=('texlive-core' 'texlive-latexextra')
source=("https://github.com/bebraw/pypandoc/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('1ca753ac2da9ad1a98c72aa639b6809e31d8c5da85a3a843f91675f95861e5056c183f67d73008c064b8fd2c82a4cd255f20b1c0073cc288a1e0e6a74caa9f94')

build() {
  cd pypandoc-$pkgver
  python -m build -wn
}

check() {
  cd pypandoc-$pkgver
  # https://github.com/NicklasTegner/pypandoc/issues/278
  python tests.py || echo "Tests failed"
}

package() {
  cd pypandoc-$pkgver
  python -m installer -d "$pkgdir" dist/*.whl
  install -D -m644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
